跳到主要内容

监控Redis

最后于 更新

步骤​

1. 打开配置文件​

Kubernetes 环境​

kubectl edit cm apo-grafana-alloy-config -n apo

传统服务器环境​

配置文件默认路径为探针安装路径下的 config/grafana-alloy/config.alloy。

2. 配置监控项​

在配置文件中增加以下内容:

// 采集 Redis 指标
prometheus.exporter.redis "example" {
redis_addr = "<redis-url>:6379"
redis_password = "password"
}

prometheus.scrape "redis" {
targets = prometheus.exporter.redis.example.targets
forward_to = [otelcol.receiver.prometheus.default.receiver]
}

其中按需修改以下配置:

  • redis_addr: Redis 地址
  • redis_password: Redis 密码

3. 检查指标数据​

在修改配置文件后,需重启探针。要验证指标数据是否采集成功,请打开 APO 页面,点击“中间件大盘”标签页,打开 Elasticsearch 监控指标大盘,查看指标。

更多​

更多可配置项请参考文档。